package jude.java.money.task;

import jude.java.framework.thread.TimeObserver;
import jude.java.money.provide.Provider;

@Deprecated
public abstract class TimeObservableTask<T> extends BaseTask<T> implements TimeObserver {
	
	private long startTime;
	private long lastActiveTime;
	
	protected TimeObservableTask(Provider<T> provider) {
		super(provider);
	}
	
	@Override
	public void run() {
		startTime = lastActiveTime = System.currentTimeMillis();
		super.run();
	}
	
	protected boolean beforeExecute(T o) {
//		signal();
		return true;
	};

//	protected void signal() {
//		lastActiveTime = System.currentTimeMillis();
//	}
	
	@Override
	public long getStartTime() {
		return startTime;
	}
	
	@Override
	public long getLastActiveTime() {
		return lastActiveTime;
	}
}
